package com.earthea.scaffold.common.entity;

import com.earthea.scaffold.common.enums.HttpCodeEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 公共响应体
 */
@Getter
@Setter
public class BaseDataRsp<T> extends BaseRsp {
    private T data;

    public BaseDataRsp() {
        setCode(HttpCodeEnum.SUCCESS.getCode());
        setMsg(HttpCodeEnum.SUCCESS.getMsg());
    }

    public BaseDataRsp(T data) {
        this();
        this.data = data;
    }

    public BaseDataRsp(HttpCodeEnum httpCodeEnum) {
        setCode(httpCodeEnum.getCode());
        setMsg(httpCodeEnum.getMsg());
    }
}
